package wayPointTest;

import static org.junit.Assert.*;
import lejos.robotics.navigation.WayPoint;

import org.junit.Before;
import org.junit.Test;

import WayPoints.NERecorder;

public class NERecorderRecordingOnePath {
	
	protected NERecorder recorder;
	protected WayPoint aPoint;

	@Before
	public void setUp() {
		this.recorder = new NERecorder();
		
		this.aPoint = new WayPoint(10, 10);
		
		this.recorder.addWayPoint(aPoint);
		
	}
	
	@Test
	public void destinationPathShouldContainPoint() {
		assertTrue(recorder.getCurrentDestination().getPath().contains(this.aPoint));
		
	}
	
	@Test
	public void afterAddingANewWayPointDestinationPathShouldContainTwoWayPoints() {
		WayPoint newWayPoint = new WayPoint(1,1);
		
		this.recorder.addWayPoint(newWayPoint);
		assertTrue(recorder.getCurrentDestination().getPath().size() == 2);
		assertTrue(recorder.getCurrentDestination().getPath().get(1) == newWayPoint);
		
	}

}
